hvm: Destroy timers early during domain death.
authorKeir Fraser <keir@xensource.com>
Wed, 27 Jun 2007 21:20:17 +0000 (22:20 +0100)
committerKeir Fraser <keir@xensource.com>
Wed, 27 Jun 2007 21:20:17 +0000 (22:20 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/hvm.c

index 2d730f6682ef6bdf6c6ee49f5b388aed9227fec1..71ca313f8aef531db9c718ff815ee75c56fc2f38 100644 (file)
@@ -242,6 +242,11 @@ void hvm_domain_relinquish_resources(struct domain *d)
 {
     hvm_destroy_ioreq_page(d, &d->arch.hvm_domain.ioreq);
     hvm_destroy_ioreq_page(d, &d->arch.hvm_domain.buf_ioreq);
+
+    pit_deinit(d);
+    rtc_deinit(d);
+    pmtimer_deinit(d);
+    hpet_deinit(d);
 }
 
 void hvm_domain_destroy(struct domain *d)
@@ -421,17 +426,6 @@ int hvm_vcpu_initialise(struct vcpu *v)
 
 void hvm_vcpu_destroy(struct vcpu *v)
 {
-    struct domain *d = v->domain;
-
-    if ( v->vcpu_id == 0 )
-    {
-        /* NB. All these really belong in hvm_domain_destroy(). */
-        pit_deinit(d);
-        rtc_deinit(d);
-        pmtimer_deinit(d);
-        hpet_deinit(d);
-    }
-
     vlapic_destroy(v);
     hvm_funcs.vcpu_destroy(v);